#include "loginview.h"
#include "ui_loginview.h"

LoginView::LoginView(QWidget *parent) :
    BaseView(parent),
    ui(new Ui::LoginView)
{
    ui->setupUi(this);
    init();
}

void LoginView::init()
{
    this->setWindowTitle("登录");

    connect(ui->loginBtn,&QPushButton::clicked,this,&LoginView::onLoginBtn);
}

//void LoginView::showView()
//{
//    this->show();
//}

//void LoginView::hideView()
//{
//    this->hide();
//}

void LoginView::onLoginBtn()
{
    QString account = ui->accountEdit->text();
    QString pwd = ui->pwdEdit->text();
    QString role = ui->roleCombox->currentText();
    QSharedPointer<Data> dataPtr(new LoginData(account,pwd,role));
    notify(dataPtr);
}

LoginView::~LoginView()
{
    delete ui;
}
